(define-public (stack-stx (amount-ustx uint)
                          (pox-addr (tuple (version (buff 1)) (hashbytes (buff 32))))
                          (start-burn-ht uint)
                          (lock-period uint)
                          (signer-sig (optional (buff 65)))
                          (signer-key (buff 33))
                          (max-amount uint)
                          (auth-id uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 stack-stx amount-ustx pox-addr start-burn-ht lock-period signer-sig signer-key max-amount auth-id)
)

(define-public (stack-increase
  (increase-by uint)
  (signer-sig (optional (buff 65)))
  (signer-key (buff 33))
  (max-amount uint)
  (auth-id uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 stack-increase increase-by signer-sig signer-key max-amount auth-id)
)

(define-public (stack-extend (extend-count uint)
                             (pox-addr { version: (buff 1), hashbytes: (buff 32) })
                             (signer-sig (optional (buff 65)))
                             (signer-key (buff 33))
                             (max-amount uint)
                             (auth-id uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 stack-extend extend-count pox-addr signer-sig signer-key max-amount auth-id)
)

(define-public (delegate-stx (amount-ustx uint)
                             (delegate-to principal)
                             (until-burn-ht (optional uint))
                             (pox-addr (optional { version: (buff 1), hashbytes: (buff 32) })))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 delegate-stx amount-ustx delegate-to until-burn-ht pox-addr)
)

(define-public (revoke-delegate-stx)
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 revoke-delegate-stx)
)

(define-public (allow-contract-caller (caller principal) (until-burn-ht (optional uint)))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 allow-contract-caller caller until-burn-ht)
)

(define-public (disallow-contract-caller (caller principal))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 disallow-contract-caller caller)
)

(define-read-only (check-caller-allowed)
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 check-caller-allowed)
)

(define-public (delegate-stack-stx (stacker principal)
                                   (amount-ustx uint)
                                   (pox-addr { version: (buff 1), hashbytes: (buff 32) })
                                   (start-burn-ht uint)
                                   (lock-period uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 delegate-stack-stx stacker amount-ustx pox-addr start-burn-ht lock-period)
)

(define-public (stack-aggregation-commit-indexed (pox-addr { version: (buff 1), hashbytes: (buff 32) })
                                                 (reward-cycle uint)
                                                 (signer-sig (optional (buff 65)))
                                                 (signer-key (buff 33))
                                                 (max-amount uint)
                                                 (auth-id uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 stack-aggregation-commit-indexed pox-addr reward-cycle signer-sig signer-key max-amount auth-id)
)

(define-public (stack-aggregation-commit (pox-addr { version: (buff 1), hashbytes: (buff 32) })
                                                 (reward-cycle uint)
                                                 (signer-sig (optional (buff 65)))
                                                 (signer-key (buff 33))
                                                 (max-amount uint)
                                                 (auth-id uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 stack-aggregation-commit pox-addr reward-cycle signer-sig signer-key max-amount auth-id)
)

(define-public (stack-aggregation-increase (pox-addr { version: (buff 1), hashbytes: (buff 32) })
                                           (reward-cycle uint)
                                           (reward-cycle-index uint)
                                           (signer-sig (optional (buff 65)))
                                           (signer-key (buff 33))
                                           (max-amount uint)
                                           (auth-id uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 stack-aggregation-increase pox-addr reward-cycle reward-cycle-index signer-sig signer-key max-amount auth-id)
)

(define-public (delegate-stack-extend
                    (stacker principal)
                    (pox-addr { version: (buff 1), hashbytes: (buff 32) })
                    (extend-count uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 delegate-stack-extend stacker pox-addr extend-count)
)

(define-public (delegate-stack-increase
                    (stacker principal)
                    (pox-addr { version: (buff 1), hashbytes: (buff 32) })
                    (increase-by uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 delegate-stack-increase stacker pox-addr increase-by)
)

(define-public (set-signer-key-authorization (pox-addr { version: (buff 1), hashbytes: (buff 32)})
                                             (period uint)
                                             (reward-cycle uint)
                                             (topic (string-ascii 14))
                                             (signer-key (buff 33))
                                             (allowed bool)
                                             (max-amount uint)
                                             (auth-id uint))
  (contract-call? 'ST000000000000000000002AMW42H.pox-4 set-signer-key-authorization pox-addr period reward-cycle topic signer-key allowed max-amount auth-id)
)
